package com.mysite.angular.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mysite.angular.common.BaseController;
import com.mysite.angular.po.AcMenu;
import com.mysite.angular.po.AcOperator;
import com.mysite.angular.service.MenuService;
import com.mysite.angular.service.OperatorService;

import javax.servlet.http.HttpServletRequest;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/sys/operator")
public class OperatorController extends BaseController {

	@Autowired
	private OperatorService operatorService;
	
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getMenuListByPage(@RequestBody Map<String, Object> searchMap, HttpServletRequest request) throws Exception {
		List<AcOperator> resultList = operatorService.getOperatorList(searchMap);
		Map<String, Object> resultMap = new HashMap<String, Object>();
		resultMap.put("totalRecord", searchMap.get("totalRecord"));
		resultMap.put("data", resultList);
		return resultMap;
	}
}
